import axios from "axios"
export let getlist = ()=>{
    return (dispatch)=>{ //异步返回一个函数
        axios.get("/list").then(res=>{
            dispatch({
                type:"getlist",
                payload:res.data
            })
        })
    }
}
export let addShop = (payload)=>{ // 同步返回一个对象
    return {
        type:"addShop",
        payload
    }
}
export let addFn = (id)=>{
    return {
        type:"addFn",
        payload:id
    }
}
export let delFn = (id)=>{
    return {
        type :"delFn",
        payload:id
    }
}
export let checkItem = (id)=>{
    return {
        type:"checkItem",
        payload:id
    }
}
export let checkallfn = ()=>{
    return {
        type:"checkallfn"
    }
}
export let delete1fn = (id)=>{
    return {
        type:"delete1fn",
        payload:id
    }
}
export let addAaddress = (item)=>{
    return {
        type:"addAaddress",
        payload:item
    }
}
export let deladdress = (index)=>{
    return {
        type:"deladdress",
        payload:index
    }
}